using System;
using System.ComponentModel;

namespace PyBindingTest
{
    public class Person : INotifyPropertyChanged
    {
        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                if (value == _name)
                    return;

                _name = value;
                OnPropertyChanged("Name");
            }
        }

        private int _age;
        public int Age
        {
            get { return _age; }
            set
            {
                if (value == _age)
                    return;

                _age = value;
                OnPropertyChanged("Age");
            }
        }
        private bool _isNinja;
        public bool IsNinja
        {
            get { return _isNinja; }
            set
            {
                if (value == _isNinja)
                    return;

                _isNinja = value;
                OnPropertyChanged("IsNinja");
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged == null)
                return;

            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
